<?php

require_once 'Zend/Db/Table/Abstract.php';

/**
 * Schemata table model
 */
class Default_Model_Schemata extends Zend_Db_Table_Abstract
{
    
    protected $_mapper;
    
    public function setMapper($mapper)
    {
        $this->_mapper = $mapper;
        return $this;
    }

    public function getMapper()
    {
        if (null === $this->_mapper) {
            $this->setMapper(new Default_Model_SchemataMapper());
        }
        return $this->_mapper;
    }

    /**
     * Get list of data bases names.
     * List is formated for extjs treeNodes
     * @return array
     */
    public function getAllDataBases()
    {
        // Get all data base names from mapper
        $dataBases = $this->getMapper()->getAllDataBases();

        return $dataBases;
    }
}

